import api from '../index'
import type { ResponseData,pageParam,RequestFromType } from '../index'

// 获取分组统计消息
export const getMessageCount = () =>
	api.get<ResponseData<{unreadCount:number}[]>>('customer/api/message/group/count')


// 我的消息列表
export const getMessageList = (type:string,data:pageParam) =>
	api.get(`customer/api/message/list/${type}`,{
			data,
		}
	)
	
//详情
export const getMessageDetail = (id:string|number) =>
	api.get(`customer/api/message/detail/${id}`)

// 已读一条消息-或者全部	
export const readMessage = (type:string, data:{messageId:string}) =>
	api.post(`customer/api/message/read/${type}`,{
			data
		}
	)
